import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/front',
    name: 'front',
    meta: { title: "用户界面" },
    component: () => import(/* webpackChunkName: "about" */ '../views/userpage/index.vue'),
    children: [
      {
        path: "/",
        name: "homepage",
        meta: { title: "主页" },
        // 路由懒加载
        component: () => import("../views/userpage/pages/Homepage.vue"),
      },
      {
        path: "/forumcenter",
        name: "forumcenter",
        meta: { title: "论坛中心" },
        // 路由懒加载
        component: () => import("../views/userpage/pages/Forumcenter.vue"),
      },
      {
        path: "/forumcenterdetail",
        name: "forumcenterdetail",
        meta: { title: "文章详情" },
        // 路由懒加载
        component: () => import("../views/userpage/pages/Forumcenterdetail.vue"),
      },
      {
        path: "/vaccinreservation",
        name: "vaccinreservation",
        meta: { title: "疫苗预约" },
        // 路由懒加载
        component: () => import("../views/userpage/pages/Vaccinreservation.vue"),
      },
      {
        path: "/backhelp",
        name: "backhelp",
        meta: { title: "反馈帮助" },
        // 路由懒加载
        component: () => import("../views/userpage/pages/Backhelp.vue"),
      },
      {
        path: "/userlogin",
        name: "userlogin",
        meta: { title: "用户登录" },
        // 路由懒加载
        component: () => import("../views/userpage/pages/Userlogin.vue"),
      },
      {
        path: "/personl",
        name: "personl",
        meta: { title: "个人中心" },
        // 路由懒加载
        component: () => import("../views/userpage/pages/Personl.vue"),
        children: [
          {
            path: "/mineself",
            name: "mineself",
            meta: { title: "个人信息" },
            // 路由懒加载
            component: () => import("../views/userpage/pages/mine/Mineself.vue"),
          },
          {
            path: "/myarticle",
            name: "myarticle",
            meta: { title: "个人论坛" },
            // 路由懒加载
            component: () => import("../views/userpage/pages/mine/Myarticle.vue"),
          },
          {
            path: "/order",
            name: "order",
            meta: { title: "个人预约" },
            // 路由懒加载
            component: () => import("../views/userpage/pages/mine/Order.vue"),
          },
          {
            path: "/vaccinate",
            name: "vaccinate",
            meta: { title: "个人接种" },
            // 路由懒加载
            component: () => import("../views/userpage/pages/mine/Vaccinate.vue"),
          },
        ]
      },
    ],
  },
  {
    path: "/adminlogin",
    name: "adminlogin",
    meta: { title: "登录" },
    // 路由懒加载
    component: () => import("../views/adminpage/Adminlogin.vue"),
  },
  {
    path: '/index',
    name: 'index',
    meta: { title: "管理系统" },
    component: () => import(/* webpackChunkName: "about" */ '../views/adminpage/layout/index.vue'),
    children: [
      {
        path: "/home",
        name: "home",
        meta: { title: "主页" },
        // 路由懒加载
        component: () => import("../views/adminpage/Home.vue"),
      },
    ],
  },
  {
    path: '/statistics',
    name: 'statistics',
    meta: { title: "数据统计" },
    component: () => import(/* webpackChunkName: "about" */ '../views/adminpage/layout/index.vue'),
    children: [
      {
        path: "/vstatistics",
        name: "vstatistics",
        meta: { title: "接种统计" },
        // 路由懒加载
        component: () => import("../views/adminpage/statisticsmanage/Vstatistics.vue"),
      },
      {
        path: "/sstatistics",
        name: "sstatistics",
        meta: { title: "论坛统计" },
        // 路由懒加载
        component: () => import("../views/adminpage/statisticsmanage/Sstatistics.vue"),
      },
    ],
  },
  {
    path: '/vaccins',
    name: 'vaccins',
    meta: { title: "疫苗管理" },
    component: () => import(/* webpackChunkName: "about" */ '../views/adminpage/layout/index.vue'),
    children: [
      {
        path: "/vaccin",
        name: "vaccin",
        meta: { title: "疫苗信息" },
        // 路由懒加载
        component: () => import("../views/adminpage/vaccinmanage/Vaccin.vue"),
      },
      {
        path: "/vaccinadd",
        name: "vaccinadd",
        meta: { title: "疫苗登记" },
        // 路由懒加载
        component: () => import("../views/adminpage/vaccinmanage/Vaccinadd.vue"),
      },
    ],
  },
  {
    path: '/inoculations',
    name: 'inoculations',
    meta: { title: "接种管理" },
    component: () => import(/* webpackChunkName: "about" */ '../views/adminpage/layout/index.vue'),
    children: [
      {
        path: "/tojab",
        name: "tojab",
        meta: { title: "接种操作" },
        // 路由懒加载
        component: () => import("../views/adminpage/inoculationmanage/Tojab.vue"),
      },
      {
        path: "/user",
        name: "user",
        meta: { title: "用户信息" },
        // 路由懒加载
        component: () => import("../views/adminpage/inoculationmanage/User.vue"),
      },
      {
        path: "/reservation",
        name: "ireservation",
        meta: { title: "预约信息" },
        // 路由懒加载
        component: () => import("../views/adminpage/inoculationmanage/Reservation.vue"),
      },
      {
        path: "/inoculation",
        name: "inoculation",
        meta: { title: "接种信息" },
        // 路由懒加载
        component: () => import("../views/adminpage/inoculationmanage/Inoculation.vue"),
      },
      {
        path: "/toinoculation",
        name: "toinoculation",
        meta: { title: "接种地址" },
        // 路由懒加载
        component: () => import("../views/adminpage/inoculationmanage/Toinoculation.vue"),
      },
    ],
  },
  {
    path: '/message',
    name: 'message',
    meta: { title: "信息管理" },
    component: () => import(/* webpackChunkName: "about" */ '../views/adminpage/layout/index.vue'),
    children: [
      {
        path: "/notice",
        name: "notice",
        meta: { title: "公告信息" },
        // 路由懒加载
        component: () => import("../views/adminpage/messagemanage/Notice.vue"),
      },
      {
        path: "/forum",
        name: "forum",
        meta: { title: "论坛信息" },
        // 路由懒加载
        component: () => import("../views/adminpage/messagemanage/Forum.vue"),
      },
    ],
  },
  {
    path: '/feedbacks',
    name: 'feedbacks',
    meta: { title: "反馈管理" },
    component: () => import(/* webpackChunkName: "about" */ '../views/adminpage/layout/index.vue'),
    children: [
      {
        path: "/feedback",
        name: "feedback",
        meta: { title: "反馈信息" },
        // 路由懒加载
        component: () => import("../views/adminpage/feedbackmanage/Feedback.vue"),
      },
    
    ],
  },
  {
    path: '/system',
    name: 'system',
    meta: { title: "系统管理" },
    component: () => import(/* webpackChunkName: "about" */ '../views/adminpage/layout/index.vue'),
    children: [
      {
        path: "/admin",
        name: "admin",
        meta: { title: "角色管理" },
        // 路由懒加载
        component: () => import("../views/adminpage/systemmanage/Admin.vue"),
      },
      {
        path: "/mine",
        name: "mine",
        meta: { title: "个人管理" },
        // 路由懒加载
        component: () => import("../views/adminpage/systemmanage/Mine.vue"),
      },
    ],
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
